import request from '@/utils/request'

export function listUser(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/user/list',
    method: 'post',
    data
  })
}

export function postUser(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/user/post',
    method: 'post',
    data
  })
}

export function patchUser(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/user/patch',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/user/delete',
    method: 'post',
    data: {
      id: data
    }
  })
}

export function listEmployee(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/employee/list',
    method: 'post',
    data
  })
}

export function postEmployee(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/employee/post',
    method: 'post',
    data
  })
}

export function patchEmployee(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/employee/patch',
    method: 'post',
    data
  })
}

export function deleteEmployee(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/employee/delete',
    method: 'post',
    data: {
      id: data
    }
  })
}

export function listStudent(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/student/list',
    method: 'post',
    data
  })
}

export function postStudent(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/student/post',
    method: 'post',
    data
  })
}

export function patchStudent(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/student/patch',
    method: 'post',
    data
  })
}

export function deleteStudent(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/student/delete',
    method: 'post',
    data: {
      id: data
    }
  })
}

export function listRole(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/role/list',
    method: 'post',
    data
  })
}

export function postRole(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/role/post',
    method: 'post',
    data
  })
}

export function patchRole(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/role/patch',
    method: 'post',
    data
  })
}

export function deleteRole(data) {
  return request({
    baseURL: 'http://127.0.0.1:8199/api',
    url: '/role/delete',
    method: 'post',
    data: {
      id: data
    }
  })
}
